{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'name': 'Alice', 'age': 30, 'city': 'New York'}\n",
      "Alice\n",
      "Age is in the dictionary.\n"
     ]
    }
   ],
   "source": [
    "# 创建一个空的字典  \n",
    "row_data = {}  \n",
    "  \n",
    "# 添加键值对到字典中  \n",
    "row_data['name'] = 'Alice'  \n",
    "row_data['age'] = 30  \n",
    "row_data['city'] = 'New York'  \n",
    "  \n",
    "# 打印字典  \n",
    "print(row_data)  \n",
    "# 输出：{'name': 'Alice', 'age': 30, 'city': 'New York'}  \n",
    "  \n",
    "# 访问字典中的值  \n",
    "print(row_data['name'])  \n",
    "# 输出：Alice  \n",
    "  \n",
    "# 检查键是否在字典中  \n",
    "if 'age' in row_data:  \n",
    "    print(\"Age is in the dictionary.\")  \n",
    "# 输出：Age is in the dictionary.\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
